package com.javaee.wordtree.entity;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

/**
 * Deepseek API 响应实体类
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
public class DeepseekResponse {
    // 场景图像的 base64 编码
    private String sceneImage;
    
    // 分段索引信息
    private Integer segmentIndex;
    
    // 分段详细信息
    private SegmentInfo segmentInfo;

    // 关键词数组
    private List<String> keywords;

    public List<String> getKeywords() {
        return keywords;
    }

    public void setKeywords(List<String> keywords) {
        this.keywords = keywords;
    }

    // API 返回的选项列表
    @JsonProperty("choices")
    private List<Choice> choices = new ArrayList<>();

    /**
     * 选项类
     */
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class Choice {
        @JsonProperty("message")
        private Message message;

        /**
         * 消息类
         */
        @Data
        @NoArgsConstructor
        @AllArgsConstructor
        public static class Message {
            @JsonProperty("role")
            private String role;

            @JsonProperty("content")
            private String content;
        }
    }

    /**
     * 分段信息类
     */
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class SegmentInfo {
        private int currentIndex;
        private int totalSegments;
        private boolean hasChoices;
        private boolean isEnding;
    }
}